//
//  DBManage.h
//  Doctor
//
//  Created by duwen on 13-1-16.
//  Copyright (c) 2013年 duwen. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FMDatabase.h"
#import "FMDatabaseAdditions.h"
#define DB_NAME @"CACHE.db"

@interface DBManage : NSObject{
    FMDatabase *db;
}

- (void)createEditableCopyOfDatabaseIfNeeded;
-(void)insertGoodsData:(NSArray *)goodsArr;
-(void)SelcetDate:(NSString *)title withChannel:(NSString *)channel;
-(NSMutableArray *)selectNewCollect:(NSString *)titleStr withChannel:(NSString *)channeStr;
-(void)deleteData:(NSString *)title;
-(NSMutableArray *)goodsDetialArr;
-(NSMutableArray *)goodNumArray:(int)Num;
-(NSMutableArray*)Judgment:(NSString *)timerr;
-(void)deleteGoodsInfoInGoodsTable:(NSString*)Title;
-(void)insertGoodsPihao:(NSString*)gPid;
-(void)insertGoodsPihao:(NSString*)gPid AndUrl:(NSString * )url;

-(BOOL)findPihaoEqualToNpihao:(NSString*)newPihao;
-(void)updataBase:(NSString *)Phao;
-(void)updataBase:(NSString *)Phao Andzaiku:(NSString *)zaiku Andbeizhu:(NSString*)beizhu;
-(NSMutableArray*)yichaArr;
-(NSMutableArray*)weichaArr:(NSString*)kumingcheng;
-(NSMutableArray*)searchArr:(NSString*)phao;
-(NSMutableArray*)chaku:(NSString*)tate;
-(void)updateCang:(NSString *)pihao AndmaxUrl:(NSString*)max AndminUrl:(NSString*)min Andbianhao:(NSString*)bian;
-(void)updateCang:(NSString *)pihao AndmaxUrl:(NSString*)max;
-(NSMutableArray*)shangchuanArr:(NSString*)bianhao;


//离线下载
-(void)insertData:(NSArray *)offLine;
-(NSMutableArray *)getOffLine;
-(void)deleteData:(NSString *)type whthChannel:(NSString *)channel_id wihtTitle:(NSString *)title;
//数据下载
-(void)insertCache:(NSArray *)cache;
-(NSMutableArray *)cache;
@end
